# -*- coding: utf-8 -*-
import socket
import time

from Ini_utils import UtilIni


class Sockets:
    def __init__(self):
        self.ip = (UtilIni().getvalue('lnfluxDB', "ip"))
        self.port = int(UtilIni().getvalue('lnfluxDB', "port"))
        self.connect = self.socketConnect()

    def socketConnect(self):
        self.soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.soc.connect((self.ip, self.port))

    def send_message(self):
        self.socketConnect()


if __name__ == '__main__':
    Sockets().connect()
    mes = 'D2CF00360302D82080001B0201112189860467092180171205FFFFFFFFFFFF4C5A355242374433384C42303033303838FFFFFFFFFFFFFFFF7654'
    Sockets().socketClient(message=mes)
    time.sleep(2)
    mes2 = 'D2CF00850302D820804918170B0D173B0A5AFFFFFFFFFF0104FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF141B5BCA010B183850282BFFFF000000070F1FFC0252D544FFFFFFFFFFFF01FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFFFFFFFF34923D31A4F3267D6408100B05ECB761313231343535333430323937EC13'
    Sockets().socketClient(message=mes2)
